package robot.map;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

import robot.Robot;
import robot.RobotConsole;



public class EnvironmentMap extends RobotMap {

	private static final long serialVersionUID = 7920963471075602149L;

	public EnvironmentMap(RobotConsole robotConsole, Robot robot) {
		super(robotConsole, robot);
		
		this.addMouseMotionListener(new MouseMotionListener() {
			
			@Override
			public void mouseMoved(MouseEvent arg0) {
				// nothing
			}
			
			@Override
			public void mouseDragged(MouseEvent arg0) {
				drawMyPoint(arg0.getX(), arg0.getY());
			}
		});
		
		this.addMouseListener(new MouseListener() {
			
			@Override
			public void mouseReleased(MouseEvent arg0) {
				// nothing
			}
			
			@Override
			public void mousePressed(MouseEvent arg0) {
				drawMyPoint(arg0.getX(), arg0.getY());
			}
			
			@Override
			public void mouseExited(MouseEvent arg0) {
				// nothing
			}
			
			@Override
			public void mouseEntered(MouseEvent arg0) {
				// nothing
			}
			
			@Override
			public void mouseClicked(MouseEvent arg0) {
				// nothing
			}
		});
	}
	
	private void drawMyPoint(int x, int y) {
		//System.out.println(x + " - " + y);
		addRectangle(ObjectType.OBJECT, x - 1, y - 1, 3, 3);
	}
	
}
